<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Consultar Plan</title>
    </head> 

    <ui:composition template="./../../resources/template/facesTemplate.xhtml">
        <ui:define name="content">
            <h:body>
                <h:form id="frm">
                    <div>
                        <fieldset>
                            <h3><h:outputText value="#{loginBean.ubicacion}"/></h3>
                            <div class="tablaForm">
                                <div class="fila">
                                    <div class="etiq"><label for="modelo">Seleccione un Modelo</label></div>
                                    <div class="cont"><h:selectOneMenu id="modelo" value="#{motostockBean.motoFiltro}">
                                            <f:selectItems value="#{motostockBean.listaMoto}"/>
                                        </h:selectOneMenu></div>
                                </div>
                                <div class="fila">
                                    <div class="etiq"><label for="precioCosto">Precio de Costo</label></div>
                                    <div class="cont">
                                        <h:inputText id="precioCosto" styleClass="d_num" value="#{motostockBean.precioCosto}">
                                            <f:convertNumber pattern="#{motostockBean.formatNumero}"/>
                                            <f:ajax event="change" listener="#{motostockBean.calcularPrecioGrupal()}" render=" @this precioContado precioBase"/>
                                        </h:inputText>
                                    </div>
                                </div>
                                <div class="fila">
                                    <div class="etiq"><label for="precioContado">Precio Contado</label></div>
                                    <div class="cont">
                                        <h:inputText id="precioContado" styleClass="d_num" value="#{motostockBean.precioContado}">
                                            <f:convertNumber pattern="#{motostockBean.formatNumero}"/>
                                        </h:inputText>
                                    </div>
                                </div>
                                <div class="fila">
                                    <div class="etiq"><label for="precioBase">Precio Base</label></div>
                                    <div class="cont">
                                        <h:inputText id="precioBase" styleClass="d_num" value="#{motostockBean.precioBase}">
                                            <f:convertNumber pattern="#{motostockBean.formatNumero}"/>
                                        </h:inputText>
                                    </div>
                                </div>
                            </div>
                            <div class="botonera">
                                <h:commandButton value="Guardar" action="#{motostockBean.guardarPrecioGrupal}"/>
                                <h:commandButton value="Cancelar" immediate="true" action="main"/>                                
                            </div>
                        </fieldset>
                    </div>
                </h:form>
            </h:body>
        </ui:define>
    </ui:composition>
</html>